using System;
using System.Collections.Generic;
using System.Text;
using MacomberMap.Common.Types;
using System.Data.Common;
using System.Xml;
using System.ComponentModel;
using MacomberMap.Common.User_Interfaces.Components;

namespace MacomberMap.Common.Components
{
    /// <summary>
    /// This class holds information on the busbar section
    /// </summary>
    [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.Both)]
    public class MM_BusbarSection: MM_Element
    {
        #region Variable declarations
        /// <summary>The node associated with the busbar section</summary>
        private MM_Node _AssociatedNode;

        /// <summary>The node associated with the busbar section</summary>
        [Category("Data"), Description("The node associated with the busbar section"), MM_Serializable_Target(MM_Serializable_Target.enumTargetType.TypeCollection)]
        public MM_Node AssociatedNode
        {
            get { return _AssociatedNode; }
            set { _AssociatedNode = value; }
        }
        #endregion

         #region Initialization
        /// <summary>
        /// Initialize a new node from a data reader
        /// </summary>
        /// <param name="ElementSource"></param>
        public MM_BusbarSection(DbDataReader ElementSource) : base(ElementSource) 
        {
            this.ElemType = MM_Overall_Display.ElemTypes["BusbarSection"];
        }

        /// <summary>
        /// Initialize a new node from an XML document
        /// </summary>
        /// <param name="ElementSource"></param>
        public MM_BusbarSection(XmlElement ElementSource) : base(ElementSource)             
        {
            this.ElemType = MM_Overall_Display.ElemTypes["BusbarSection"];
        }

        /// <summary>
        /// Initialize a parameterless node
        /// </summary>
        public MM_BusbarSection()
            : base()
        {
            this.ElemType = MM_Overall_Display.ElemTypes["BusbarSection"];        
        }         
        #endregion
    }
}
